# -*- coding: utf-8 -*-

import urllib2
import time

_address = "http://10.0.0.11/"


def getImage():
  f = urllib2.urlopen(_address+"Jpeg/CamImg0001.jpg")
  return f

old = ""
stuff = []
if __name__=="__main__":
  start = time.time()
  for i in range(100):
    stuff.append(getImage())
  t = time.time() - start
  start = time.time()
  for i in stuff:
    new = i.read()
    if new == old:
      print "they are the same"
    old = new
  t2 = time.time() - start
  print "Time per pic:" + str(t/100)
  print "fps:" + str(100/t)
  print "Time per pic:" + str(t2/100)
  print "fps:" + str(100/t2)